<?php 
/**
 * 景点相关的控制器类
 */
class KeywordAction extends ManagerAction{
	/**
	 * 景点列表
	 */
	function clist(){
		$BloackList = M('hot_keywords');
		$count=$BloackList->count();
		$Page = new Page($count,C('PAGE_COUNT'));
		$limit = "{$Page->firstRow},{$Page->listRows}";
		$list = $BloackList->limit($limit)->order("create_time DESC")->select();
		$this->assign('list',$list);
		$this->assign('page',$Page->show());
		$this->display();	
	}
	function add(){
		if($_POST){
			$Content = D('hot_keywords');
			$data['keyword'] = $_POST['keyword'];
			$data['create_time']=$_SERVER['REQUEST_TIME'];
			$Content->add($data);
			$this->success("添加成功！");
		}else{
			$this->display();
		}
	}
	function del(){
		$id=$_GET['id'];
		$Content = D('hot_keywords');
		$Content->where("id={$id}")->delete();
		$this->success("删除成功!");
	}
	function update(){
		$id=$_REQUEST['id'];
		$Content = D('hot_keywords');
		if($_POST){
			$Content->save($_POST);
			$this->assign('jumpUrl',U("Manager-hotkeywords/clist"));
			$this->success('修改成功');
		}else{
			$bl_info = $Content->where("id={$id}")->find();
			$this->assign('bl_info',$bl_info);
			$this->display();
		}
	}
}
?>
